<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<meta name="RSA" th:unless="${user.id}" th:content="${encryptionUtils.getRsaPublicKey(#request)}">
<th:block data-th-replace="/adminlte/base::base-head"></th:block>
</head>
<body class="hold-transition login-page">
	<div class="login-box">
		<div class="login-logo">
			<a href="/"><strong th:utext="${siteInfo.title}"></strong></a>
		</div>
		<div class="card">
          <div class="card-body login-card-body">
                <p class="login-box-msg">您忘记密码了? 输入您绑定的邮箱</p>
                <form action="/accounts/emails/reset" method="post" data-encry-type="RSA" 
                    data-success="(status, data, headers)=>toast.success(getMessage(headers), undefined, 3000)">
                    <div class="input-group mb-3">
                        <input type="email" name="email" class="form-control"
                            placeholder="邮箱地址" required="required">
                        <div class="input-group-append">
                            <div class="input-group-text">
                                <span class="fas fa-envelope"></span>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <button type="submit" class="btn btn-primary btn-block">获取验证码</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
		<div class="card mt-3">
		      <div class="card-body login-card-body">
		          <p class="login-box-msg">请输入验证码和新的密码</p>
                <form action="/accounts/emails/reset" method="put" data-encry-type="RSA" 
                    data-success="(status, data, header)=>toast.success(getMessage(header), ()=>skip('/admin/login'));">
                    <div class="input-group mb-3">
                         验证码：<input type="text" class="form-control" name="code" placeholder="邮箱验证码" autocomplete="new-username">
                         <div class="input-group-append">
                             <div class="input-group-text">
                                 <span class="fas fa-lock"></span>
                             </div>
                         </div>
                     </div>
                     <div class="input-group mt-3 mb-3">
                         新密码：<input id="password" type="password" class="form-control" name="password" autocomplete="new-password"
                             placeholder="输入新密码">
                         <div class="input-group-append">
                             <div class="input-group-text">
                                 <span class="fas fa-lock"></span>
                             </div>
                         </div>
                     </div>
                     <div class="input-group mb-3">
                         新密码：<input type="password" class="form-control" autocomplete="new-password"
                             placeholder="再次输入" onblur="checkInputSame(this, '#password')" required="required">
                         <div class="input-group-append">
                             <div class="input-group-text">
                                 <span class="fas fa-lock"></span>
                             </div>
                         </div>
                     </div>
                    <div class="row">
                        <div class="col-12">
                            <button type="submit" class="btn btn-primary btn-block">修改密码</button>
                        </div>
                    </div>
                </form>

                <p class="mt-3 mb-1">
                    <a href="/admin/login">回到登陆</a>
                </p>
                <p class="mb-0">
                    <a href="/admin/account/register" class="text-center">注册新账号</a>
                </p>
            </div>
		</div>
	</div>
	<th:block data-th-replace="/adminlte/base::base-js"></th:block>
	<script src="/kaibes/js/base.js"></script>
    <script src="/kaibes/js/toast.js"></script>
    <script src="/kaibes/js/network.js"></script>
</body>
</html>
